package string;

import java.util.Arrays;

public class SplitDemo2 {
    public static void main(String[] args) {
        String str = "a=b=c=d=e=f=========";
        String[] arr = str.split("=");
        System.out.println(Arrays.toString(arr));

        arr = str.split("=", 2);
        System.out.println(Arrays.toString(arr));

        arr = str.split("=", 3);
        System.out.println(Arrays.toString(arr));

        arr = str.split("=", 50);
        System.out.println(Arrays.toString(arr));

        arr = str.split("=", 0);
        System.out.println(Arrays.toString(arr));
        /*
           当limit小于0时，应拆尽拆
         */
        arr = str.split("=", -1);
        System.out.println(Arrays.toString(arr));
    }
}
